package com.cmas.platform.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.cmas.platform.vo.LastNotificationVo;
import com.cmas.platform.vo.NotificationVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.cmas.platform.domain.Notification;

import java.util.List;

/**
 * 推送表Mapper接口
 *
 * @author su
 * @email 1218819874@qq.com
 * @date 2024-05-14
 */
@Mapper
public interface NotificationMapper extends BaseMapper<Notification> {

    /**
     * 批量删除推送表
     *
     * @param ids 需要删除的推送表ID集合
     * @return
     */
    public int deleteNotificationByIds(@Param("ids") String[] ids, @Param("DEL_FLAG_DELETE") String DEL_FLAG_DELETE);


    public List<NotificationVo> selectNotificationVoList(@Param(Constants.WRAPPER) QueryWrapper<Notification> setQueryWrapper);


    public List<LastNotificationVo> selectLastNotification(@Param("current") int current, @Param("size") int size,
                                                           @Param("userId") String userId, @Param("regionId") String regionId);

    public LastNotificationVo selectRegionNotification(@Param("id") String id);


    public int unReadNotificationCount(@Param("userId") String userId,
                                       @Param("regionId") String regionId);
}
